package com.example.service.impl;

import com.example.service.MessageService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

public class MessageServiceImpl implements MessageService {

    private ArrayList<String> list = new ArrayList<String>();

    @Override
    public void sendMessage(String id) {
        System.out.println("加入消息队列中进行等待id:"+id);
        list.add(id);
    }

    @Override
    public String doMessage() {
        String id = list.remove(0);
        System.out.println("完成该消息处理id:"+id);
        System.out.println("111111");
        return id;
    }
}
